package cn.itsource.api.fallback;

import cn.itsource.api.openfeign.IRuleOpenfeignClient;
import cn.itsource.constants.ErrorCode;
import cn.itsource.pojo.dto.ExpectPriceDto;
import cn.itsource.pojo.ro.ExpectPriceRo;
import cn.itsource.result.JSONResult;
import org.aspectj.weaver.NewFieldTypeMunger;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class RuleFallbackFactory implements FallbackFactory<IRuleOpenfeignClient> {


    @Override
    public IRuleOpenfeignClient create(Throwable cause) {
        return new IRuleOpenfeignClient() {
            @Override
            public JSONResult<ExpectPriceDto> expectPrice(ExpectPriceRo expectPriceRo) {
                return JSONResult.error(ErrorCode.SERVICE_REQUEST_ERROR);
            }


        };
    }
}
